import request from '@/utils/request';
//查询阈值配置列表
export function getThresholdList(params) {

  console.log('params',params);

  return request({
    url: '/iot/threshold-config/list',
    method: 'get',
    params: params || { pageNum: 1, pageSize: 10000 } // 获取所有数据，用于前端分页
  })
};

//阈值字典
export function getThresholdDict(code) {
  return request({
    url: '/system/dict/data/listByDictType',
    method: 'get',
    params: {
      DictType: code,
    }
  })
};
//新增阈值配置

export function addThresholdConfig(data) {
  return request({
    url: '/iot/threshold-config',
    method: 'post',
    data: data
  })
}
//删除 /iot/threshold-config/{id}
export function deleteThresholdConfig(id) {
  return request({
    url: '/iot/threshold-config/' + id,
    method: 'delete'
  })
}

//修改阈值配置
export function updateThresholdConfig(data) {
  return request({
    url: '/iot/threshold-config',
    method: 'put',
    data: data
  })
}
